CREATE TABLE [agency].[Contact]
(
[ContactId] [int] NOT NULL IDENTITY(1, 1),
[AddressId] [int] NOT NULL,
[ContactTypeId] [int] NOT NULL,
[AgentId] [int] NULL,
[PersonName] [int] NOT NULL,
[ContactText] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[Active] [bit] NOT NULL,
[Deleted] [bit] NOT NULL,
[CreatedBy] [int] NOT NULL,
[CreatedOn] [datetime] NOT NULL,
[ModifiedBy] [int] NULL,
[ModifiedOn] [datetime] NULL
) ON [PRIMARY]
GO
ALTER TABLE [agency].[Contact] ADD CONSTRAINT [PK_Contact] PRIMARY KEY CLUSTERED  ([ContactId]) ON [PRIMARY]
GO
ALTER TABLE [agency].[Contact] ADD CONSTRAINT [FK_Contact_Address] FOREIGN KEY ([AddressId]) REFERENCES [agency].[Address] ([AddressId])
GO
ALTER TABLE [agency].[Contact] ADD CONSTRAINT [FK_Contact_Agent] FOREIGN KEY ([AgentId]) REFERENCES [agency].[Agent] ([AgentId])
GO
